//
//  Y2Router.h
//  Y2Router
//
//  Created by harry.tong on 2021/6/3.
//

#import <Foundation/Foundation.h>
#import "Y2EventBusProtocol.h"
#import "Aspects.h"

@interface Y2Router : NSObject<Y2EventBusProtocol>

+(void) registerForModule:(Class<Y2EventBusProtocol>_Nonnull)cls protocol:(Protocol<Y2EventBusProtocol>* _Nonnull)ptl;

+(id _Nullable) callWithProtocol:(NSString * _Nonnull)protocol
                      moduleType:(NSString * _Nonnull)type
                          method:(NSString * _Nonnull)method
                            args:(NSDictionary * _Nullable)args;

///  方法调用
/// [组织名]://Bundle identifier/sdk/modeule_type/protocol_name/method_name?argument
/// modeule_type 声明可选值：plugins, channels
/// protocol_name 为对外保留协议名
/// 例子：Nebulajoy://com.ycgames.sdk.demo/sdk/open/Plugin_IDFA_Protocol/get_ifa?args=1231231
/// NSException 为NULL 没有报错，方法正常调用
+(id _Nullable) handleURL:(NSString *_Nonnull)url;


/// iOS生命周期传递
+(void) applicationLiftCycleMethod:(SEL _Nonnull)sel info:(id<AspectInfo> _Nonnull)info;


@end

